package com.api.hg.web;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.api.hg.action.assetAction;
import com.api.hg.action.assetDiscovery;
import com.engine.common.util.ParamUtil;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import java.util.HashMap;
import java.util.Map;
@Path("/hgass")
public class assDiscoveryApi {
    @POST
    @Path("/discovery")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String NewXiaoz(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.SysDiscovery(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    @POST
    @Path("/singlediscovery")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String SysSingleDiscovery(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.SysSingleDiscovery(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    @POST
    @Path("/swlist")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String getTableDataSW(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.getTableDataSW(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    //getSubTableDataSW
    @POST
    @Path("/subswlist")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String getSubTableDataSW(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.getSubTableDataSW(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    /**
     * 部门下发科室  盘点
     * @param var1
     * @param var2
     * @return
     */
    @POST
    @Path("/issuedepdiscovery")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String IssueDepDiscovery(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.IssueDepDiscovery(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    /**
     * 部门下发个人  盘点
     * @param var1
     * @param var2
     * @return
     */
    @POST
    @Path("/issuedepsinglediscovery")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String IssueDepSingleDiscovery(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.IssueDepSingleDiscovery(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    /**
     * 部门下发部门管理员  盘点
     * @param var1
     * @param var2
     * @return
     */
    @POST
    @Path("/issuedepsysadmindiscovery")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String IssueDepSysadminDiscovery(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.IssueDepSysadminDiscovery(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    @POST
    @Path("/depswlist")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String getDepTableDataSW(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.getDepTableDataSW(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    /**
     * 部门下发部门管理员  盘点
     * @param var1
     * @param var2
     * @return
     */
    @POST
    @Path("/issuekssysadmindiscovery")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String IssueKsSysadminDiscovery(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.IssueKsSysadminDiscovery(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
    /**
     * 科室下发个人  盘点
     * @param var1
     * @param var2
     * @return
     */
    @POST
    @Path("/issueksdiscovery")
    @Produces({"text/plain"})
    //public String UpdModelRole(JSONObject json){
    public String IssueKsDiscovery(@Context HttpServletRequest var1, @Context HttpServletResponse var2){
        Map<String, Object> apidatas = new HashMap<String, Object>();
        JSONArray zcinfo=new JSONArray();
        String errormess="";
        try{
            User user = HrmUserVarify.getUser(var1, var2);
            assetDiscovery assetDiscovery=new assetDiscovery();
            apidatas=assetDiscovery.IssueKsDiscovery(ParamUtil.request2Map(var1),user);
        }catch(Exception e){

        }

        return JSONObject.toJSONString(apidatas);
    }
}
